//
//  BKMatchingScholarshipTableViewCell.m
//  baokaodaxue
//
//  Created by SKar on 15/6/1.
//  Copyright (c) 2015年 宏图教育. All rights reserved.
//

#import "BKMatchingScholarshipTableViewCell.h"

@implementation BKMatchingScholarshipTableViewCell

+ (UINib *)nib {
    return [UINib nibWithNibName:NSStringFromClass([BKMatchingScholarshipTableViewCell class]) bundle:nil];
}

- (void)awakeFromNib {
    // Initialization code
    
    UIView *view = [[UIView alloc] init];
    view.backgroundColor = [UIColor clearColor];
    self.backgroundView= view;
    
    
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
    if (selected) {
        _isSelecteImageView.image = [UIImage imageNamed:@"selected"];
    }else{
        
        _isSelecteImageView.image = [UIImage imageNamed:@"unselected"];
    }
}

@end

@implementation BKMatchingScholarshipTableViewCell (ConfigureCell)

- (void)configureCellForDic:(NSDictionary *)dic {
    self.collegeNameLabel.text = dic[@"name"];
    self.scholarshipLabel.text = dic[@"edu"];
    self.conditionLabel.text = dic[@"biaozhun"];
}


- (void)drawRect:(CGRect)rect{

    CGContextRef context = UIGraphicsGetCurrentContext();
    
    CGContextSetLineWidth(context, .8);
    
    CGContextSetRGBStrokeColor(context, .5, .5, .5, 1);
    
    CGContextMoveToPoint(context,0, rect.size.height);
    CGContextAddLineToPoint(context, 0, 0);
    CGContextAddLineToPoint(context,rect.size.width, 0);
    CGContextAddLineToPoint(context,rect.size.width, rect.size.height);
//    CGContextAddLineToPoint(context,0, rect.size.height);
//    CGContextAddLineToPoint(context,0, 0);
    CGContextStrokePath(context);
    
    CGContextSetLineWidth(context, .5);
    
    CGContextSetRGBStrokeColor(context, .5, .5, .5, .5);
    
    CGFloat height = rect.size.height;
    CGFloat width = rect.size.width/3;
    CGContextMoveToPoint(context, width, 0);
    CGContextAddLineToPoint(context,width, height);
    CGContextStrokePath(context);
    
    CGContextMoveToPoint(context, width*2, 0);
    CGContextAddLineToPoint(context,width*2, height);
    CGContextStrokePath(context);
    

    
}
@end